//
//  MHTabBarController.m
// MiaoCircle
//
//Created by acgera on 2018/4/9.
//  Copyright © 2018年 acgera. All rights reserved.
//

#import "MHTabBarController.h"
#import "MHTabBar.h"
@interface MHTabBarController ()
/// tabBarController
//@property (nonatomic, strong, readwrite) CYLTabBarController *tabBarController;
@end

@implementation MHTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    
     UIEdgeInsets imageInsets = UIEdgeInsetsMake(8, 0, -8, 0);
    self.tabBarController = [[CYLTabBarController alloc] initWithViewControllers:nil tabBarItemsAttributes:nil imageInsets:imageInsets titlePositionAdjustment:UIOffsetZero];
    /// 添加子控制器
    [self.view addSubview:self.tabBarController.view];
    [self addChildViewController:self.tabBarController];
    [self.tabBarController didMoveToParentViewController:self];
    self.tabBarController.tabBar.layer.shadowColor = [UIColor blackColor].CGColor;
    self.tabBarController.tabBar.layer.shadowOffset = CGSizeMake(0, -1);
    self.tabBarController.tabBar.layer.shadowOpacity = 0.1;
    
    
    
//    // kvc替换系统的tabBar
//    MHTabBar *tabbar = [[MHTabBar alloc] init];
//    //kvc实质是修改了系统的_tabBar
//    [self.tabBarController setValue:tabbar forKeyPath:@"tabBar"];
    
}



//#pragma mark - Ovveride
//- (BOOL)shouldAutorotate {
//    return self.tabBarController.selectedViewController.shouldAutorotate;
//}
//
//- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
//    return self.tabBarController.selectedViewController.supportedInterfaceOrientations;
//}
//
//- (UIStatusBarStyle)preferredStatusBarStyle {
//    return self.tabBarController.selectedViewController.preferredStatusBarStyle;
//}
//
//- (BOOL)prefersStatusBarHidden{
//    return self.tabBarController.selectedViewController.prefersStatusBarHidden;
//}
@end
